<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use \Illuminate\Routing\Router;
use App\Http\Controllers\Guard\Login\LoginController;
use App\Http\Controllers\Guard\Rbac\PermissionController;
use App\Http\Controllers\Guard\Rbac\GuardUserController;
use App\Http\Controllers\Guard\Rbac\RoleController;
use App\Http\Controllers\Guard\Index\IndexController;
use App\Http\Controllers\Guard\Site\SettingController;
use App\Http\Controllers\Guard\Article\ArticleClassifyController;
use App\Http\Controllers\Guard\Article\ArticleInfoController;
use App\Http\Controllers\Guard\Advert\AdvertController;
use App\Http\Controllers\Guard\Advert\ChannelController;
use App\Http\Controllers\Guard\User\UserController;
use App\Http\Controllers\Guard\Shop\GoodsSpecController;
use App\Http\Controllers\Guard\Shop\GoodsClassifyController;
use App\Http\Controllers\Guard\Shop\GoodsSpuController;
use App\Http\Controllers\Guard\Shop\GoodsBrandController;
use App\Http\Controllers\Guard\Shop\GoodsSpecValueController;
use App\Http\Controllers\Guard\Flight\OrderController;
use App\Http\Controllers\Guard\Flight\FlightInfoController;


/****************************************** guard ************************************************/

//登录
Route::match(['get','post'],'/login',[LoginController::class,'login']);
Route::get('/getToken',[LoginController::class,'getToken']);
Route::get('/logout',[LoginController::class,'logout']);
Route::get('/changeCol',[LoginController::class,'changeCol']);
Route::any('/upload',[LoginController::class,'upload']);
Route::get('/getVerifyCodeImg',[LoginController::class,'getVerifyCodeImg']);
Route::get('/getArea',[LoginController::class,'getArea']);
Route::get('/download',[LoginController::class,'download']);
Route::get('/getpdf',[LoginController::class,'getPDF']);

Route::post('/importFile',[LoginController::class,'importFile']);

//rbac权限管理
Route::group(['prefix'=>'rbac','middleware'=>'guard'],function(Router $router){

    $router->get('/getGuardUser',[IndexController::class,'getGuardUser']);
    $router->get('/loginLog',[IndexController::class,'loginLog']);

    $router->match(['get','post'],'/permission/lst',[PermissionController::class,'lst']);
    $router->match(['get','post'],'/permission/add',[PermissionController::class,'add']);
    $router->get('/permission/detail',[PermissionController::class,'detail']);
    $router->get('/permission/del',[PermissionController::class,'del']);

    $router->get('/role/lst',[RoleController::class,'lst']);
    $router->match(['get','post'],'/role/add',[RoleController::class,'add']);
    $router->get('/role/del',[RoleController::class,'del']);
    $router->get('/role/detail',[RoleController::class,'detail']);

    $router->get('/guardUser/getPermission',[GuardUserController::class,'getPermission']);
    $router->get('/guardUser/lst',[GuardUserController::class,'lst']);
    $router->match(['get','post'],'/guardUser/add',[GuardUserController::class,'add']);
    $router->get('/guardUser/detail',[GuardUserController::class,'detail']);
    $router->get('/guardUser/getUserByToken',[GuardUserController::class,'getUserByToken']);
    $router->get('/guardUser/del',[GuardUserController::class,'del']);
    $router->post('/guardUser/edit',[GuardUserController::class,'edit']);
    $router->post('/guardUser/resetPassword',[GuardUserController::class,'resetPassword']);
    $router->post('/guardUser/coverPassword',[GuardUserController::class,'coverPassword']);


});

//系统设置
Route::group(['prefix'=>'site'],function(Router $router){

    $router->match(['get','post'],'/setting/index',[SettingController::class,'index']);

});

//广告管理
Route::group(['prefix'=>'advert'],function(Router $router){
    $router->get('/lst',[AdvertController::class,'lst']);
    $router->get('/del',[AdvertController::class,'del']);
    $router->post('/change',[AdvertController::class,'change']);
    $router->get('/detail',[AdvertController::class,'detail']);
    $router->match(['get','post'],'/add',[AdvertController::class,'add']);

    $router->get('/channel/lst',[ChannelController::class,'lst']);
    $router->get('/channel/detail',[ChannelController::class,'detail']);
    $router->post('/channel/add',[ChannelController::class,'add']);
    $router->get('/channel/change',[ChannelController::class,'change']);


});

//文章管理
Route::group(['prefix'=>'article'],function(Router $router){

    //分类
    $router->get('/classify/lst',[ArticleClassifyController::class,'lst']);
    $router->get('/classify/detail',[ArticleClassifyController::class,'detail']);
    $router->get('/classify/del',[ArticleClassifyController::class,'del']);
    $router->match(['get','post'],'/classify/add',[ArticleClassifyController::class,'add']);

    //列表
    $router->any('/uploadImg',[ArticleInfoController::class,'uploadImg']);
    $router->any('/uploadVideo',[ArticleInfoController::class,'uploadVideo']);
    $router->get('/lst',[ArticleInfoController::class,'lst']);
    $router->get('/detail',[ArticleInfoController::class,'detail']);
    $router->get('/del',[ArticleInfoController::class,'del']);
    $router->match(['get','post'],'/add',[ArticleInfoController::class,'add']);
    $router->match(['get','post'],'/change',[ArticleInfoController::class,'change']);

});

//航班管理
Route::group(['prefix'=>'flight'],function(Router $router){

    $router->get('/lst',[FlightInfoController::class,'lst']);
    $router->get('/detail',[FlightInfoController::class,'detail']);
    $router->get('/del',[FlightInfoController::class,'del']);
    $router->get('/edit',[FlightInfoController::class,'edit']);
    $router->match(['get','post'],'/add',[FlightInfoController::class,'add']);


    $router->get('/order/getDefaultFlight',[OrderController::class,'getDefaultFlight']);
    $router->get('/order/getOrderCode',[OrderController::class,'getOrderCode']);
    $router->get('/order/lst',[OrderController::class,'lst']);
    $router->get('/order/detail',[OrderController::class,'detail']);
    $router->match(['get','post'],'/order/edit',[OrderController::class,'edit']);
    $router->match(['get','post'],'/order/beizhu',[OrderController::class,'beizhu']);
    $router->get('/order/del',[OrderController::class,'del']);
    $router->match(['get','post'],'/order/add',[OrderController::class,'add']);

});
//用户管理
Route::group(['prefix'=>'user'],function(Router $router){

    $router->get('/lst',[UserController::class,'lst']);
    $router->get('/detail',[UserController::class,'detail']);
    $router->get('/del',[UserController::class,'del']);
    $router->match(['get','post'],'/add',[UserController::class,'add']);

});

//商城
Route::group(['prefix'=>'shop'],function(Router $router){

    $router->group(['prefix'=>'goods'],function () use($router){

        //品牌管理
        $router->get('/brand/lst',[GoodsBrandController::class,'lst']);
        $router->post('/brand/add',[GoodsBrandController::class,'add']);
        $router->get('/brand/detail',[GoodsBrandController::class,'detail']);
        $router->get('/brand/changeStatus',[GoodsBrandController::class,'changeStatus']);

        //spu管理
        $router->get('/spu/lst',[GoodsSpuController::class,'lst']);
        $router->post('/spu/add',[GoodsSpuController::class,'add']);
        $router->get('/spu/detail',[GoodsSpuController::class,'detail']);
        $router->get('/spu/del',[GoodsSpuController::class,'del']);
        $router->get('/spu/changeStatus',[GoodsSpuController::class,'changeStatus']);

        //规格管理
        $router->get('/spec/lst',[GoodsSpecController::class,'lst']);
        $router->post('/spec/add',[GoodsSpecController::class,'add']);
        $router->get('/spec/detail',[GoodsSpecController::class,'detail']);
        $router->get('/spec/del',[GoodsSpecController::class,'del']);

        //规格值管理
        $router->get('/spec/value/add',[GoodsSpecValueController::class,'add']);

        //分类
        $router->get('/classify/lst',[GoodsClassifyController::class,'lst']);
        $router->get('/classify/add',[GoodsClassifyController::class,'add']);
        $router->get('/classify/detail',[GoodsClassifyController::class,'detail']);
        $router->get('/classify/del',[GoodsClassifyController::class,'del']);
    });
});






